package com.example.userservice.novel.repository;

import com.example.userservice.novel.entity.GenerationHistoryEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GenerationHistoryRepository extends JpaRepository<GenerationHistoryEntity, Long> {

    // 根据生成状态查找
    List<GenerationHistoryEntity> findBySuccess(Boolean success);

    // 查找最近的生成历史
    List<GenerationHistoryEntity> findTop20ByOrderByCreatedAtDesc();
}
